home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / biblio / bibtex / contrib / geralpha / geralpha.bst < prev    next >
Internet Message Format  |  1991-09-27  |  27KB

  1. Received: From DHDURZ1(MAILER) by DS0RUS54 with Jnet id 2694
  2.           for ZRFN0370@DS0RUS54; Mon, 15 Oct 90 14:27 A
  3. Received: from DHDURZ1 (DANTE) by DHDURZ1 (Mailer R2.03B) with BSMTP id 2687;
  4.  Mon, 15 Oct 90 14:25:48 CET
  5. Date:         Mon, 15 Oct 90 14:24:52 CET
  6. From:         "DANTE e.V." <DANTE@DHDURZ1>
  7. Subject:      geralpha.bst
  8. To:           Barbara Burr <ZRFN0370@DS0RUS54>
  9.  
  10.  
  11. %
  12. % Adapted bibliography style `geralpha' that changes several english-language
  13. % ``constants'' in the style.
  14. %
  15. % Copyright of the changes (C) 1990 by
  16. %  Robert Tolksdorf
  17. %  K\"ortestr. 30
  18. %  D-1000 Berlin 61
  19. %  West Germany
  20. %
  21. % NO WARRANTY!
  22. %
  23. % Version 0   as of 28.05.90
  24. %         0.1       31.07.90
  25. %         1.0       21.09.90
  26. % HOW TO FIND THE CHANGES:
  27. %  Since there were no comments in my original ``alpha''-style all comment-
  28. %  lines denote my changes.
  29. % PROBLEMS:
  30. %  I had problems to change the month-name ``March'' into ``M\"arz''. Somehow
  31. %  the umlaut is not accepted. Experimenting with "a from the
  32. %  ``german''-option did not work as well. If you have a hint how to include
  33. %  umlauts in a bst, please report.
  34. % OUTLOOK:
  35. %  This file could be used as a guide to change the other
  36. %  standard-styles. Since I am using only ``alpha'' as I prefer to have
  37. %  those impressing looking abbreviations in my bibliographies, I am too
  38. %  lazy to publish a complete set of bibliography-styles. If you adapt
  39. %  another style, please send a copy (5 1/4" or 3 1/2", 360 KB or 720 KB,
  40. %  no HD-disks!).
  41. % BUGS:
  42. %  There may still be some entries or fields that are not adapted. I am
  43. %  developping this style for about one year, but surely do not have used
  44. %  all entry-types or entry-field-combinations. Please report any
  45. %  anormalities!
  46. %
  47.  
  48. % BibTeX standard bibliography style `alpha'
  49.         % version 0.99a for BibTeX versions 0.99a or later, LaTeX version 2.09.
  50.         % Copyright (C) 1985, all rights reserved.
  51.         % Copying of this file is authorized only if either
  52.         % (1) you make absolutely no changes to your copy, including name, or
  53.         % (2) if you do make changes, you name it something other than
  54.         % btxbst.doc, plain.bst, unsrt.bst, alpha.bst, and abbrv.bst.
  55.         % This restriction helps ensure that all standard styles are identical.
  56.         % The file btxbst.doc has the documentation for this style.
  57.  
  58. ENTRY
  59.   { address
  60.     author
  61.     booktitle
  62.     chapter
  63.     edition
  64.     editor
  65.     howpublished
  66.     institution
  67.     journal
  68.     key
  69.     month
  70.     note
  71.     number
  72.     organization
  73.     pages
  74.     publisher
  75.     school
  76.     series
  77.     title
  78.     type
  79.     volume
  80.     year
  81.   }
  82.   {}
  83.   { label extra.label sort.label }
  84.  
  85. INTEGERS { output.state before.all mid.sentence after.sentence after.block }
  86.  
  87. FUNCTION {init.state.consts}
  88. { #0 'before.all :=
  89.   #1 'mid.sentence :=
  90.   #2 'after.sentence :=
  91.   #3 'after.block :=
  92. }
  93.  
  94. STRINGS { s t }
  95.  
  96. FUNCTION {output.nonnull}
  97. { 's :=
  98.   output.state mid.sentence =
  99.     { ", " * write$ }
  100.     { output.state after.block =
  101.         { add.period$ write$
  102.           newline$
  103.           "\newblock " write$
  104.         }
  105.         { output.state before.all =
  106.             'write$
  107.             { add.period$ " " * write$ }
  108.           if$
  109.         }
  110.       if$
  111.       mid.sentence 'output.state :=
  112.     }
  113.   if$
  114.   s
  115. }
  116.  
  117. FUNCTION {output}
  118. { duplicate$ empty$
  119.     'pop$
  120.     'output.nonnull
  121.   if$
  122. }
  123.  
  124. FUNCTION {output.check}
  125. { 't :=
  126.   duplicate$ empty$
  127.     { pop$ "empty " t * " in " * cite$ * warning$ }
  128.     'output.nonnull
  129.   if$
  130. }
  131.  
  132. FUNCTION {output.bibitem}
  133. { newline$
  134.   "\bibitem[" write$
  135.   label write$
  136.   "]{" write$
  137.   cite$ write$
  138.   "}" write$
  139.   newline$
  140.   ""
  141.   before.all 'output.state :=
  142. }
  143.  
  144. FUNCTION {fin.entry}
  145. { add.period$
  146.   write$
  147.   newline$
  148. }
  149.  
  150. FUNCTION {new.block}
  151. { output.state before.all =
  152.     'skip$
  153.     { after.block 'output.state := }
  154.   if$
  155. }
  156.  
  157. FUNCTION {new.sentence}
  158. { output.state after.block =
  159.     'skip$
  160.     { output.state before.all =
  161.         'skip$
  162.         { after.sentence 'output.state := }
  163.       if$
  164.     }
  165.   if$
  166. }
  167.  
  168. FUNCTION {not}
  169. {   { #0 }
  170.     { #1 }
  171.   if$
  172. }
  173.  
  174. FUNCTION {and}
  175. {   'skip$
  176.     { pop$ #0 }
  177.   if$
  178. }
  179.  
  180. FUNCTION {or}
  181. {   { pop$ #1 }
  182.     'skip$
  183.   if$
  184. }
  185.  
  186. FUNCTION {new.block.checka}
  187. { empty$
  188.     'skip$
  189.     'new.block
  190.   if$
  191. }
  192.  
  193. FUNCTION {new.block.checkb}
  194. { empty$
  195.   swap$ empty$
  196.   and
  197.     'skip$
  198.     'new.block
  199.   if$
  200. }
  201.  
  202. FUNCTION {new.sentence.checka}
  203. { empty$
  204.     'skip$
  205.     'new.sentence
  206.   if$
  207. }
  208.  
  209. FUNCTION {new.sentence.checkb}
  210. { empty$
  211.   swap$ empty$
  212.   and
  213.     'skip$
  214.     'new.sentence
  215.   if$
  216. }
  217.  
  218. FUNCTION {field.or.null}
  219. { duplicate$ empty$
  220.     { pop$ "" }
  221.     'skip$
  222.   if$
  223. }
  224.  
  225. FUNCTION {emphasize}
  226. { duplicate$ empty$
  227.     { pop$ "" }
  228.     { "{\em " swap$ * "}" * }
  229.   if$
  230. }
  231.  
  232. INTEGERS { nameptr namesleft numnames }
  233.  
  234. FUNCTION {format.names}
  235. { 's :=
  236.   #1 'nameptr :=
  237.   s num.names$ 'numnames :=
  238.   numnames 'namesleft :=
  239.     { namesleft #0 > }
  240.     { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=
  241.       nameptr #1 >
  242.         { namesleft #1 >
  243.             { ", " * t * }
  244. %
  245. % Now here we have discovered a bug. The bibliography of the LaTeX-book shows
  246. % the fault: If there are three or more authors, then the final ``and'' before
  247. % the last author's name is preceeded by a comma. This looks ugly and is
  248. % wrong.
  249. % The original and faulty line in format.names reads
  250. %            { numnames #2 >
  251. % Actually the generation of the comma is dependent on the number of names
  252. % left. Therefore:
  253. %
  254.             { namesleft #2 >
  255.                 { "," * }
  256.                 'skip$
  257.               if$
  258.               t "others" =
  259.                 { " et~al." * }
  260. % ``and'' is ``und'' in German
  261.                 { " und " * t * }
  262.               if$
  263.             }
  264.           if$
  265.         }
  266.         't
  267.       if$
  268.       nameptr #1 + 'nameptr :=
  269.       namesleft #1 - 'namesleft :=
  270.     }
  271.   while$
  272. }
  273.  
  274. FUNCTION {format.authors}
  275. { author empty$
  276.     { "" }
  277.     { author format.names }
  278.   if$
  279. }
  280.  
  281. FUNCTION {format.editors}
  282. { editor empty$
  283.     { "" }
  284.     { editor format.names
  285.       editor num.names$ #1 >
  286. % Let's call them ``Herausgeber''
  287. %        { ", editors" * }
  288. %        { ", editor" * }
  289.         { ", Hrsg." * }
  290.         { ", Hrsg." * }
  291.       if$
  292.     }
  293.   if$
  294. }
  295.  
  296. FUNCTION {format.title}
  297. { title empty$
  298.     { "" }
  299. % I want the title as typed in the database here RT
  300. %    { title "t" change.case$ }
  301.     'title
  302.   if$
  303. }
  304.  
  305. FUNCTION {n.dashify}
  306. { 't :=
  307.   ""
  308.     { t empty$ not }
  309.     { t #1 #1 substring$ "-" =
  310.         { t #1 #2 substring$ "--" = not
  311.             { "--" *
  312.               t #2 global.max$ substring$ 't :=
  313.             }
  314.             {   { t #1 #1 substring$ "-" = }
  315.                 { "-" *
  316.                   t #2 global.max$ substring$ 't :=
  317.                 }
  318.               while$
  319.             }
  320.           if$
  321.         }
  322.         { t #1 #1 substring$ *
  323.           t #2 global.max$ substring$ 't :=
  324.         }
  325.       if$
  326.     }
  327.   while$
  328. }
  329.  
  330. FUNCTION {format.date}
  331. { year empty$
  332.     { month empty$
  333.         { "" }
  334.         { "there's a month but no year in " cite$ * warning$
  335.           month
  336.         }
  337.       if$
  338.     }
  339.     { month empty$
  340.         'year
  341.         { month " " * year * }
  342.       if$
  343.     }
  344.   if$
  345. }
  346.  
  347. FUNCTION {format.btitle}
  348. { title emphasize
  349. }
  350.  
  351. FUNCTION {tie.or.space.connect}
  352. { duplicate$ text.length$ #3 <
  353.     { "~" }
  354.     { " " }
  355.   if$
  356.   swap$ * *
  357. }
  358.  
  359. FUNCTION {either.or.check}
  360. { empty$
  361.     'pop$
  362.     { "can't use both " swap$ * " fields in " * cite$ * warning$ }
  363.   if$
  364. }
  365.  
  366. FUNCTION {format.bvolume}
  367. { volume empty$
  368.     { "" }
  369. % ``volume'' is ``Jahrgang'' in German. The abbrv. is ``Jgg.'' (DUDEN)
  370. %   { "volume" volume tie.or.space.connect
  371.     { "Jgg." volume tie.or.space.connect
  372.       series empty$
  373.         'skip$
  374.         { " of " * series emphasize * }
  375.       if$
  376.       "volume and number" number either.or.check
  377.     }
  378.   if$
  379. }
  380.  
  381. FUNCTION {format.number.series}
  382. { volume empty$
  383.     { number empty$
  384.         { series field.or.null }
  385.         { output.state mid.sentence =
  386.             { "number" }
  387.             { "Number" }
  388.           if$
  389.           number tie.or.space.connect
  390.           series empty$
  391.             { "there's a number but no series in " cite$ * warning$ }
  392.             { " in " * series * }
  393.           if$
  394.         }
  395.       if$
  396.     }
  397.     { "" }
  398.   if$
  399. }
  400.  
  401. FUNCTION {format.edition}
  402. { edition empty$
  403.     { "" }
  404.     { output.state mid.sentence =
  405. % `edition' is `Auflage' in german
  406. %        { edition "l" change.case$ " edition" * }
  407. %        { edition "t" change.case$ " edition" * }
  408.         { edition "l" change.case$ ".~Auflage" * }
  409.         { edition "t" change.case$ ".~Auflage" * }
  410.       if$
  411.     }
  412.   if$
  413. }
  414.  
  415. INTEGERS { multiresult }
  416.  
  417. FUNCTION {multi.page.check}
  418. { 't :=
  419.   #0 'multiresult :=
  420.     { multiresult not
  421.       t empty$ not
  422.       and
  423.     }
  424.     { t #1 #1 substring$
  425.       duplicate$ "-" =
  426.       swap$ duplicate$ "," =
  427.       swap$ "+" =
  428.       or or
  429.         { #1 'multiresult := }
  430.         { t #2 global.max$ substring$ 't := }
  431.       if$
  432.     }
  433.   while$
  434.   multiresult
  435. }
  436.  
  437. FUNCTION {format.pages}
  438. { pages empty$
  439.     { "" }
  440.     { pages multi.page.check
  441. % Let's call ``page'' ``Seite''
  442. %        { "pages" pages n.dashify tie.or.space.connect }
  443. %        { "page" pages tie.or.space.connect }
  444.         { "Seiten" pages n.dashify tie.or.space.connect }
  445.         { "Seite" pages tie.or.space.connect }
  446.       if$
  447.     }
  448.   if$
  449. }
  450.  
  451. FUNCTION {format.vol.num.pages}
  452. { volume field.or.null
  453.   number empty$
  454.     'skip$
  455.     { "(" number * ")" * *
  456.       volume empty$
  457.         { "there's a number but no volume in " cite$ * warning$ }
  458.         'skip$
  459.       if$
  460.     }
  461.   if$
  462.   pages empty$
  463.     'skip$
  464.     { duplicate$ empty$
  465.         { pop$ format.pages }
  466.         { ":" * pages n.dashify * }
  467.       if$
  468.     }
  469.   if$
  470. }
  471.  
  472. FUNCTION {format.chapter.pages}
  473. { chapter empty$
  474.     'format.pages
  475.     { type empty$
  476. % ``chapter'' is ``Kapitel'' in German
  477. %        { "chapter" }
  478.         { "Kapitel" }
  479.         { type "l" change.case$ }
  480.       if$
  481.       chapter tie.or.space.connect
  482.       pages empty$
  483.         'skip$
  484.         { ", " * format.pages * }
  485.       if$
  486.     }
  487.   if$
  488. }
  489.  
  490. FUNCTION {format.in.ed.booktitle}
  491. { booktitle empty$
  492.     { "" }
  493.     { editor empty$
  494.         { "In " booktitle emphasize * }
  495.         { "In " format.editors * ", " * booktitle emphasize * }
  496.       if$
  497.     }
  498.   if$
  499. }
  500.  
  501. FUNCTION {empty.misc.check}
  502. { author empty$ title empty$ howpublished empty$
  503.   month empty$ year empty$ note empty$
  504.   and and and and and
  505.   key empty$ not and
  506.     { "all relevant fields are empty in " cite$ * warning$ }
  507.     'skip$
  508.   if$
  509. }
  510.  
  511. FUNCTION {format.thesis.type}
  512. { type empty$
  513.     'skip$
  514.     { pop$
  515.       type "t" change.case$
  516.     }
  517.   if$
  518. }
  519.  
  520. FUNCTION {format.tr.number}
  521. { type empty$
  522.     { "Technical Report" }
  523.     'type
  524.   if$
  525.   number empty$
  526.     { "t" change.case$ }
  527.     { number tie.or.space.connect }
  528.   if$
  529. }
  530.  
  531. FUNCTION {format.article.crossref}
  532. { key empty$
  533.     { journal empty$
  534.         { "need key or journal for " cite$ * " to crossref " * crossref *
  535.           warning$
  536.           ""
  537.         }
  538.         { "In {\em " journal * "\/}" * }
  539.       if$
  540.     }
  541.     { "In " key * }
  542.   if$
  543.   " \cite{" * crossref * "}" *
  544. }
  545.  
  546. FUNCTION {format.crossref.editor}
  547. { editor #1 "{vv~}{ll}" format.name$
  548.   editor num.names$ duplicate$
  549.   #2 >
  550.     { pop$ " et~al." * }
  551.     { #2 <
  552.         'skip$
  553.         { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
  554.             { " et~al." * }
  555. % ``and'' is ``und'' in German
  556.             { " und " * editor #2 "{vv~}{ll}" format.name$ * }
  557.           if$
  558.         }
  559.       if$
  560.     }
  561.   if$
  562. }
  563.  
  564. FUNCTION {format.book.crossref}
  565. { volume empty$
  566.     { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
  567.       "In "
  568.     }
  569. % ``volume'' is ``Jahrgang'' in German. See above
  570. %   { "volume" volume tie.or.space.connect
  571.     { "Jgg." volume tie.or.space.connect
  572.       " of " *
  573.     }
  574.   if$
  575.   editor empty$
  576.   editor field.or.null author field.or.null =
  577.   or
  578.     { key empty$
  579.         { series empty$
  580.             { "need editor, key, or series for " cite$ * " to crossref " *
  581.               crossref * warning$
  582.               "" *
  583.             }
  584.             { "{\em " * series * "\/}" * }
  585.           if$
  586.         }
  587.         { key * }
  588.       if$
  589.     }
  590.     { format.crossref.editor * }
  591.   if$
  592.   " \cite{" * crossref * "}" *
  593. }
  594.  
  595. FUNCTION {format.incoll.inproc.crossref}
  596. { editor empty$
  597.   editor field.or.null author field.or.null =
  598.   or
  599.     { key empty$
  600.         { booktitle empty$
  601.             { "need editor, key, or booktitle for " cite$ * " to crossref " *
  602.               crossref * warning$
  603.               ""
  604.             }
  605.             { "In {\em " booktitle * "\/}" * }
  606.           if$
  607.         }
  608.         { "In " key * }
  609.       if$
  610.     }
  611.     { "In " format.crossref.editor * }
  612.   if$
  613.   " \cite{" * crossref * "}" *
  614. }
  615.  
  616. FUNCTION {article}
  617. { output.bibitem
  618.   format.authors "author" output.check
  619.   new.block
  620.   format.title "title" output.check
  621.   new.block
  622.   crossref missing$
  623.     { journal emphasize "journal" output.check
  624.       format.vol.num.pages output
  625.       format.date "year" output.check
  626.     }
  627.     { format.article.crossref output.nonnull
  628.       format.pages output
  629.     }
  630.   if$
  631.   new.block
  632.   note output
  633.   fin.entry
  634. }
  635.  
  636. FUNCTION {book}
  637. { output.bibitem
  638.   author empty$
  639.     { format.editors "author and editor" output.check }
  640.     { format.authors output.nonnull
  641.       crossref missing$
  642.         { "author and editor" editor either.or.check }
  643.         'skip$
  644.       if$
  645.     }
  646.   if$
  647.   new.block
  648.   format.btitle "title" output.check
  649.   crossref missing$
  650.     { format.bvolume output
  651.       new.block
  652.       format.number.series output
  653.       new.sentence
  654.       publisher "publisher" output.check
  655.       address output
  656.     }
  657.     { new.block
  658.       format.book.crossref output.nonnull
  659.     }
  660.   if$
  661.   format.edition output
  662.   format.date "year" output.check
  663.   new.block
  664.   note output
  665.   fin.entry
  666. }
  667.  
  668. FUNCTION {booklet}
  669. { output.bibitem
  670.   format.authors output
  671.   new.block
  672.   format.title "title" output.check
  673.   howpublished address new.block.checkb
  674.   howpublished output
  675.   address output
  676.   format.date output
  677.   new.block
  678.   note output
  679.   fin.entry
  680. }
  681.  
  682. FUNCTION {inbook}
  683. { output.bibitem
  684.   author empty$
  685.     { format.editors "author and editor" output.check }
  686.     { format.authors output.nonnull
  687.       crossref missing$
  688.         { "author and editor" editor either.or.check }
  689.         'skip$
  690.       if$
  691.     }
  692.   if$
  693.   new.block
  694.   format.btitle "title" output.check
  695.   crossref missing$
  696.     { format.bvolume output
  697.       format.chapter.pages "chapter and pages" output.check
  698.       new.block
  699.       format.number.series output
  700.       new.sentence
  701.       publisher "publisher" output.check
  702.       address output
  703.     }
  704.     { format.chapter.pages "chapter and pages" output.check
  705.       new.block
  706.       format.book.crossref output.nonnull
  707.     }
  708.   if$
  709.   format.edition output
  710.   format.date "year" output.check
  711.   new.block
  712.   note output
  713.   fin.entry
  714. }
  715.  
  716. FUNCTION {incollection}
  717. { output.bibitem
  718.   format.authors "author" output.check
  719.   new.block
  720.   format.title "title" output.check
  721.   new.block
  722.   crossref missing$
  723.     { format.in.ed.booktitle "booktitle" output.check
  724.       format.bvolume output
  725.       format.number.series output
  726.       format.chapter.pages output
  727.       new.sentence
  728.       publisher "publisher" output.check
  729.       address output
  730.       format.edition output
  731.       format.date "year" output.check
  732.     }
  733.     { format.incoll.inproc.crossref output.nonnull
  734.       format.chapter.pages output
  735.     }
  736.   if$
  737.   new.block
  738.   note output
  739.   fin.entry
  740. }
  741.  
  742. FUNCTION {inproceedings}
  743. { output.bibitem
  744.   format.authors "author" output.check
  745.   new.block
  746.   format.title "title" output.check
  747.   new.block
  748.   crossref missing$
  749.     { format.in.ed.booktitle "booktitle" output.check
  750.       format.bvolume output
  751.       format.number.series output
  752.       format.pages output
  753.       address empty$
  754.         { organization publisher new.sentence.checkb
  755.           organization output
  756.           publisher output
  757.           format.date "year" output.check
  758.         }
  759.         { address output.nonnull
  760.           format.date "year" output.check
  761.           new.sentence
  762.           organization output
  763.           publisher output
  764.         }
  765.       if$
  766.     }
  767.     { format.incoll.inproc.crossref output.nonnull
  768.       format.pages output
  769.     }
  770.   if$
  771.   new.block
  772.   note output
  773.   fin.entry
  774. }
  775.  
  776. FUNCTION {conference} { inproceedings }
  777.  
  778. FUNCTION {manual}
  779. { output.bibitem
  780.   author empty$
  781.     { organization empty$
  782.         'skip$
  783.         { organization output.nonnull
  784.           address output
  785.         }
  786.       if$
  787.     }
  788.     { format.authors output.nonnull }
  789.   if$
  790.   new.block
  791.   format.btitle "title" output.check
  792.   author empty$
  793.     { organization empty$
  794.         { address new.block.checka
  795.           address output
  796.         }
  797.         'skip$
  798.       if$
  799.     }
  800.     { organization address new.block.checkb
  801.       organization output
  802.       address output
  803.     }
  804.   if$
  805.   format.edition output
  806.   format.date output
  807.   new.block
  808.   note output
  809.   fin.entry
  810. }
  811.  
  812. FUNCTION {mastersthesis}
  813. { output.bibitem
  814.   format.authors "author" output.check
  815.   new.block
  816.   format.title "title" output.check
  817.   new.block
  818. % A Master's thesis thesis is called ``Diplomarbeit'' in German
  819. %  "Master's thesis" format.thesis.type output.nonnull
  820.   "Diplomarbeit" format.thesis.type output.nonnull
  821.   school "school" output.check
  822.   address output
  823.   format.date "year" output.check
  824.   new.block
  825.   note output
  826.   fin.entry
  827. }
  828.  
  829. FUNCTION {misc}
  830. { output.bibitem
  831.   format.authors output
  832.   title howpublished new.block.checkb
  833.   format.title output
  834.   howpublished new.block.checka
  835.   howpublished output
  836.   format.date output
  837.   new.block
  838.   note output
  839.   fin.entry
  840.   empty.misc.check
  841. }
  842.  
  843. FUNCTION {phdthesis}
  844. { output.bibitem
  845.   format.authors "author" output.check
  846.   new.block
  847.   format.btitle "title" output.check
  848.   new.block
  849. % A PhD thesis is called ``Dissertation'' in German
  850. %  "PhD thesis" format.thesis.type output.nonnull
  851.   "Dissertation" format.thesis.type output.nonnull
  852.   school "school" output.check
  853.   address output
  854.   format.date "year" output.check
  855.   new.block
  856.   note output
  857.   fin.entry
  858. }
  859.  
  860. FUNCTION {proceedings}
  861. { output.bibitem
  862.   editor empty$
  863.     { organization output }
  864.     { format.editors output.nonnull }
  865.   if$
  866.   new.block
  867.   format.btitle "title" output.check
  868.   format.bvolume output
  869.   format.number.series output
  870.   address empty$
  871.     { editor empty$
  872.         { publisher new.sentence.checka }
  873.         { organization publisher new.sentence.checkb
  874.           organization output
  875.         }
  876.       if$
  877.       publisher output
  878.       format.date "year" output.check
  879.     }
  880.     { address output.nonnull
  881.       format.date "year" output.check
  882.       new.sentence
  883.       editor empty$
  884.         'skip$
  885.         { organization output }
  886.       if$
  887.       publisher output
  888.     }
  889.   if$
  890.   new.block
  891.   note output
  892.   fin.entry
  893. }
  894.  
  895. FUNCTION {techreport}
  896. { output.bibitem
  897.   format.authors "author" output.check
  898.   new.block
  899.   format.title "title" output.check
  900.   new.block
  901.   format.tr.number output.nonnull
  902.   institution "institution" output.check
  903.   address output
  904.   format.date "year" output.check
  905.   new.block
  906.   note output
  907.   fin.entry
  908. }
  909.  
  910. FUNCTION {unpublished}
  911. { output.bibitem
  912.   format.authors "author" output.check
  913.   new.block
  914.   format.title "title" output.check
  915.   new.block
  916.   note "note" output.check
  917.   format.date output
  918.   fin.entry
  919. }
  920.  
  921. FUNCTION {default.type} { misc }
  922.  
  923. % Changed the names of the months
  924.  
  925. MACRO {jan} {"Januar"}
  926.  
  927. MACRO {feb} {"Februar"}
  928.  
  929. % problems with the umlaut !
  930. MACRO {mar} {"Marz"}
  931.  
  932. MACRO {apr} {"April"}
  933.  
  934. MACRO {may} {"Mai"}
  935.  
  936. MACRO {jun} {"Juni"}
  937.  
  938. MACRO {jul} {"Juli"}
  939.  
  940. MACRO {aug} {"August"}
  941.  
  942. MACRO {sep} {"September"}
  943.  
  944. MACRO {oct} {"Oktober"}
  945.  
  946. MACRO {nov} {"November"}
  947.  
  948. MACRO {dec} {"Dezember"}
  949.  
  950. MACRO {acmcs} {"ACM Computing Surveys"}
  951.  
  952. MACRO {acta} {"Acta Informatica"}
  953.  
  954. MACRO {cacm} {"Communications of the ACM"}
  955.  
  956. MACRO {ibmjrd} {"IBM Journal of Research and Development"}
  957.  
  958. MACRO {ibmsj} {"IBM Systems Journal"}
  959.  
  960. MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
  961.  
  962. MACRO {ieeetc} {"IEEE Transactions on Computers"}
  963.  
  964. MACRO {ieeetcad}
  965.  {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
  966.  
  967. MACRO {ipl} {"Information Processing Letters"}
  968.  
  969. MACRO {jacm} {"Journal of the ACM"}
  970.  
  971. MACRO {jcss} {"Journal of Computer and System Sciences"}
  972.  
  973. MACRO {scp} {"Science of Computer Programming"}
  974.  
  975. MACRO {sicomp} {"SIAM Journal on Computing"}
  976.  
  977. MACRO {tocs} {"ACM Transactions on Computer Systems"}
  978.  
  979. MACRO {tods} {"ACM Transactions on Database Systems"}
  980.  
  981. MACRO {tog} {"ACM Transactions on Graphics"}
  982.  
  983. MACRO {toms} {"ACM Transactions on Mathematical Software"}
  984.  
  985. MACRO {toois} {"ACM Transactions on Office Information Systems"}
  986.  
  987. MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
  988.  
  989. MACRO {tcs} {"Theoretical Computer Science"}
  990.  
  991. READ
  992.  
  993. FUNCTION {sortify}
  994. { purify$
  995.   "l" change.case$
  996. }
  997.  
  998. INTEGERS { len }
  999.  
  1000. FUNCTION {chop.word}
  1001. { 's :=
  1002.   'len :=
  1003.   s #1 len substring$ =
  1004.     { s len #1 + global.max$ substring$ }
  1005.     's
  1006.   if$
  1007. }
  1008.  
  1009. INTEGERS { et.al.char.used }
  1010.  
  1011. FUNCTION {initialize.et.al.char.used}
  1012. { #0 'et.al.char.used :=
  1013. }
  1014.  
  1015. EXECUTE {initialize.et.al.char.used}
  1016.  
  1017. FUNCTION {format.lab.names}
  1018. { 's :=
  1019.   s num.names$ 'numnames :=
  1020.   numnames #1 >
  1021.     { numnames #4 >
  1022.         { #3 'namesleft := }
  1023.         { numnames 'namesleft := }
  1024.       if$
  1025.       #1 'nameptr :=
  1026.       ""
  1027.         { namesleft #0 > }
  1028.         { nameptr numnames =
  1029.             { s nameptr "{ff }{vv }{ll}{ jj}" format.name$ "others" =
  1030.                 { "{\etalchar{+}}" *
  1031.                   #1 'et.al.char.used :=
  1032.                 }
  1033.                 { s nameptr "{v{}}{l{}}" format.name$ * }
  1034.               if$
  1035.             }
  1036.             { s nameptr "{v{}}{l{}}" format.name$ * }
  1037.           if$
  1038.           nameptr #1 + 'nameptr :=
  1039.           namesleft #1 - 'namesleft :=
  1040.         }
  1041.       while$
  1042.       numnames #4 >
  1043.         { "{\etalchar{+}}" *
  1044.           #1 'et.al.char.used :=
  1045.         }
  1046.         'skip$
  1047.       if$
  1048.     }
  1049.     { s #1 "{v{}}{l{}}" format.name$
  1050.       duplicate$ text.length$ #2 <
  1051.         { pop$ s #1 "{ll}" format.name$ #3 text.prefix$ }
  1052.         'skip$
  1053.       if$
  1054.     }
  1055.   if$
  1056. }
  1057.  
  1058. FUNCTION {author.key.label}
  1059. { author empty$
  1060.     { key empty$
  1061.         { cite$ #1 #3 substring$ }
  1062.         { key #3 text.prefix$ }
  1063.       if$
  1064.     }
  1065.     { author format.lab.names }
  1066.   if$
  1067. }
  1068.  
  1069. FUNCTION {author.editor.key.label}
  1070. { author empty$
  1071.     { editor empty$
  1072.         { key empty$
  1073.             { cite$ #1 #3 substring$ }
  1074.             { key #3 text.prefix$ }
  1075.           if$
  1076.         }
  1077.         { editor format.lab.names }
  1078.       if$
  1079.     }
  1080.     { author format.lab.names }
  1081.   if$
  1082. }
  1083.  
  1084. FUNCTION {author.key.organization.label}
  1085. { author empty$
  1086.     { key empty$
  1087.         { organization empty$
  1088.             { cite$ #1 #3 substring$ }
  1089.             { "The " #4 organization chop.word #3 text.prefix$ }
  1090.           if$
  1091.         }
  1092.         { key #3 text.prefix$ }
  1093.       if$
  1094.     }
  1095.     { author format.lab.names }
  1096.   if$
  1097. }
  1098.  
  1099. FUNCTION {editor.key.organization.label}
  1100. { editor empty$
  1101.     { key empty$
  1102.         { organization empty$
  1103.             { cite$ #1 #3 substring$ }
  1104.             { "The " #4 organization chop.word #3 text.prefix$ }
  1105.           if$
  1106.         }
  1107.         { key #3 text.prefix$ }
  1108.       if$
  1109.     }
  1110.     { editor format.lab.names }
  1111.   if$
  1112. }
  1113.  
  1114. FUNCTION {calc.label}
  1115. { type$ "book" =
  1116.   type$ "inbook" =
  1117.   or
  1118.     'author.editor.key.label
  1119.     { type$ "proceedings" =
  1120.         'editor.key.organization.label
  1121.         { type$ "manual" =
  1122.             'author.key.organization.label
  1123.             'author.key.label
  1124.           if$
  1125.         }
  1126.       if$
  1127.     }
  1128.   if$
  1129.   duplicate$
  1130.   year field.or.null purify$ #-1 #2 substring$
  1131.   *
  1132.   'label :=
  1133.   year field.or.null purify$ #-1 #4 substring$
  1134.   *
  1135.   sortify 'sort.label :=
  1136. }
  1137.  
  1138. FUNCTION {sort.format.names}
  1139. { 's :=
  1140.   #1 'nameptr :=
  1141.   ""
  1142.   s num.names$ 'numnames :=
  1143.   numnames 'namesleft :=
  1144.     { namesleft #0 > }
  1145.     { nameptr #1 >
  1146.         { "   " * }
  1147.         'skip$
  1148.       if$
  1149.       s nameptr "{vv{ } }{ll{ }}{  ff{ }}{  jj{ }}" format.name$ 't :=
  1150.       nameptr numnames = t "others" = and
  1151.         { "et al" * }
  1152.         { t sortify * }
  1153.       if$
  1154.       nameptr #1 + 'nameptr :=
  1155.       namesleft #1 - 'namesleft :=
  1156.     }
  1157.   while$
  1158. }
  1159.  
  1160. FUNCTION {sort.format.title}
  1161. { 't :=
  1162.   "A " #2
  1163.     "An " #3
  1164.       "The " #4 t chop.word
  1165.     chop.word
  1166.   chop.word
  1167.   sortify
  1168.   #1 global.max$ substring$
  1169. }
  1170.  
  1171. FUNCTION {author.sort}
  1172. { author empty$
  1173.     { key empty$
  1174.         { "to sort, need author or key in " cite$ * warning$
  1175.           ""
  1176.         }
  1177.         { key sortify }
  1178.       if$
  1179.     }
  1180.     { author sort.format.names }
  1181.   if$
  1182. }
  1183.  
  1184. FUNCTION {author.editor.sort}
  1185. { author empty$
  1186.     { editor empty$
  1187.         { key empty$
  1188.             { "to sort, need author, editor, or key in " cite$ * warning$
  1189.               ""
  1190.             }
  1191.             { key sortify }
  1192.           if$
  1193.         }
  1194.         { editor sort.format.names }
  1195.       if$
  1196.     }
  1197.     { author sort.format.names }
  1198.   if$
  1199. }
  1200.  
  1201. FUNCTION {author.organization.sort}
  1202. { author empty$
  1203.     { organization empty$
  1204.         { key empty$
  1205.             { "to sort, need author, organization, or key in " cite$ * warning$
  1206.               ""
  1207.             }
  1208.             { key sortify }
  1209.           if$
  1210.         }
  1211.         { "The " #4 organization chop.word sortify }
  1212.       if$
  1213.     }
  1214.     { author sort.format.names }
  1215.   if$
  1216. }
  1217.  
  1218. FUNCTION {editor.organization.sort}
  1219. { editor empty$
  1220.     { organization empty$
  1221.         { key empty$
  1222.             { "to sort, need editor, organization, or key in " cite$ * warning$
  1223.               ""
  1224.             }
  1225.             { key sortify }
  1226.           if$
  1227.         }
  1228.         { "The " #4 organization chop.word sortify }
  1229.       if$
  1230.     }
  1231.     { editor sort.format.names }
  1232.   if$
  1233. }
  1234.  
  1235. FUNCTION {presort}
  1236. { calc.label
  1237.   sort.label
  1238.   "    "
  1239.   *
  1240.   type$ "book" =
  1241.   type$ "inbook" =
  1242.   or
  1243.     'author.editor.sort
  1244.     { type$ "proceedings" =
  1245.         'editor.organization.sort
  1246.         { type$ "manual" =
  1247.             'author.organization.sort
  1248.             'author.sort
  1249.           if$
  1250.         }
  1251.       if$
  1252.     }
  1253.   if$
  1254.   *
  1255.   "    "
  1256.   *
  1257.   year field.or.null sortify
  1258.   *
  1259.   "    "
  1260.   *
  1261.   title field.or.null
  1262.   sort.format.title
  1263.   *
  1264.   #1 entry.max$ substring$
  1265.   'sort.key$ :=
  1266. }
  1267.  
  1268. ITERATE {presort}
  1269.  
  1270. SORT
  1271.  
  1272. STRINGS { longest.label last.sort.label next.extra }
  1273.  
  1274. INTEGERS { longest.label.width last.extra.num }
  1275.  
  1276. FUNCTION {initialize.longest.label}
  1277. { "" 'longest.label :=
  1278.   #0 int.to.chr$ 'last.sort.label :=
  1279.   "" 'next.extra :=
  1280.   #0 'longest.label.width :=
  1281.   #0 'last.extra.num :=
  1282. }
  1283.  
  1284. FUNCTION {forward.pass}
  1285. { last.sort.label sort.label =
  1286.     { last.extra.num #1 + 'last.extra.num :=
  1287.       last.extra.num int.to.chr$ 'extra.label :=
  1288.     }
  1289.     { "a" chr.to.int$ 'last.extra.num :=
  1290.       "" 'extra.label :=
  1291.       sort.label 'last.sort.label :=
  1292.     }
  1293.   if$
  1294. }
  1295.  
  1296. FUNCTION {reverse.pass}
  1297. { next.extra "b" =
  1298.     { "a" 'extra.label := }
  1299.     'skip$
  1300.   if$
  1301.   label extra.label * 'label :=
  1302.   label width$ longest.label.width >
  1303.     { label 'longest.label :=
  1304.       label width$ 'longest.label.width :=
  1305.     }
  1306.     'skip$
  1307.   if$
  1308.   extra.label 'next.extra :=
  1309. }
  1310.  
  1311. EXECUTE {initialize.longest.label}
  1312.  
  1313. ITERATE {forward.pass}
  1314.  
  1315. REVERSE {reverse.pass}
  1316.  
  1317. FUNCTION {begin.bib}
  1318. { et.al.char.used
  1319.     { "\newcommand{\etalchar}[1]{$^{#1}$}" write$ newline$ }
  1320.     'skip$
  1321.   if$
  1322.   preamble$ empty$
  1323.     'skip$
  1324.     { preamble$ write$ newline$ }
  1325.   if$
  1326.   "\begin{thebibliography}{"  longest.label  * "}" * write$ newline$
  1327. }
  1328.  
  1329. EXECUTE {begin.bib}
  1330.  
  1331. EXECUTE {init.state.consts}
  1332.  
  1333. ITERATE {call.type$}
  1334.  
  1335. FUNCTION {end.bib}
  1336. { newline$
  1337.   "\end{thebibliography}" write$ newline$
  1338. }
  1339.  
  1340. EXECUTE {end.bib}
  1341.